611770
@@ -367,14 +367,21 @@
static boolean containsAllFastStats(Map<String, String> partParams) {
     return true;
   }
 
+  /**
+   * Determines whether the "fast stats" for the passed partitions are the same.
+   *
+   * @param oldPart Old partition to compare.
+   * @param newPart New partition to compare.
+   * @return true if the partitions are not null, contain all the "fast stats" and have the same values for these stats, otherwise false.
+   */
   public static boolean isFastStatsSame(Partition oldPart, Partition newPart) {
     // requires to calculate stats if new and old have different fast stats
     if ((oldPart != null) && oldPart.isSetParameters() && newPart != null && newPart.isSetParameters()) {
       for (String stat : StatsSetupConst.FAST_STATS) {
         if (oldPart.getParameters().containsKey(stat) && newPart.getParameters().containsKey(stat)) {
           Long oldStat = Long.parseLong(oldPart.getParameters().get(stat));
-          Long newStat = Long.parseLong(newPart.getParameters().get(stat));
-          if (!oldStat.equals(newStat)) {
+          String newStat = newPart.getParameters().get(stat);
+          if (newStat == null || !oldStat.equals(Long.parseLong(newStat))) {
             return false;
           }
         } else {
